/**
 * Created by chenxi on 2017/6/13.
 */
import Vue from 'vue';
import VueResource from 'vue-resource';

import tuanPay from './tuan-pay.vue';

Vue.use(VueResource);
Vue.filter('toFixedN', function (val, len) {
	var changenum = (parseInt(val * Math.pow(10, len) + 0.5) / Math.pow(10, len)).toString();
	var index=changenum.indexOf("."); 
	if(index < 0 && len > 0){ 
		changenum=changenum+".";
		for(var i = 0; i< len; i++){ 
			changenum=changenum+"0"; 
		}
	}else { 
		index=changenum.length-index; 
		for(var i = 0; i < (len - index) + 1; i++){ 
			changenum=changenum+"0"; 
		}
	}
	return changenum;
});

new Vue({
    el: '#tuan-pay',
    render: h => h(tuanPay)
});	
